//
//  ArticoloDVController.h
//  iTeVe
//
//  Created by Pedro Gonzalez on 28/02/14.
//  Copyright (c) 2014 SISI Software. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Articolo.h"
#import "BSKeyboardControls.h"
#import "AliquoteVC.h"
#import "Aliquota.h"
#import "ListiniArticoloVC.h"
#import "FMDBDataAccess.h"


@class ArticoloDVController;

@protocol ArticoloDVControllerDelegate <NSObject>

- (void)articoloDVControllerDidCancel:(ArticoloDVController *)controller;
- (void)articoloDVController:(ArticoloDVController *)controller didEditArticolo:(Articolo *)articolo;
- (void)articoloDVController:(ArticoloDVController *)controller didAddArticolo:(Articolo *)articolo;

@end


@interface ArticoloDVController : UITableViewController <AliquoteVCDelegate, ListiniArticoloVCDelegate>

@property (nonatomic, weak) NSObject<ArticoloDVControllerDelegate> *delegate;

@property (nonatomic, strong) Articolo *modelArticolo;

@property (nonatomic) BOOL nuovo;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *btnAnnulla;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *btnConferma;
@property (weak, nonatomic) IBOutlet UILabel *lblCodice;
@property (weak, nonatomic) IBOutlet UILabel *lblDescrizione;
@property (weak, nonatomic) IBOutlet UIButton *btnAliquota;
@property (weak, nonatomic) IBOutlet UILabel *lblCosto;
@property (weak, nonatomic) IBOutlet UILabel *lblUnitaMisura;

@property (weak, nonatomic) IBOutlet UITextField *tfCodice;
@property (weak, nonatomic) IBOutlet UITextField *tfDescrizione;
@property (weak, nonatomic) IBOutlet UITextField *tfAliquota;
@property (weak, nonatomic) IBOutlet UITextField *tfCosto;
@property (weak, nonatomic) IBOutlet UITextField *tfUnitaMisura;
@property (weak, nonatomic) IBOutlet UITextField *tfDescrizioneAliquota;

@property (weak, nonatomic) IBOutlet UIButton *btnListiniDiVendita;
@property (weak, nonatomic) IBOutlet UIButton *btnListiniDeiClienti;
@property (nonatomic, strong) UITextField *activeField;

@end
